/*
 * Checkstyle4nb is a plugin for netbeans for checking Java coding conventions.
 * Copyright (C) 2006-2007, Andrea Matsunaga
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package com.ammatsun.checkstyle4nb.actions;

import org.netbeans.spi.options.OptionsCategory;
import org.netbeans.spi.options.OptionsPanelController;

import org.openide.util.NbBundle;
import org.openide.util.Utilities;

import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 * Checkstyle Options Category. In the Options window, a category consists of a
 * PanelController, which provides the JPanel and information about how the
 * JPanel interacts with the Options window, and one of the following
 * combinations, depending on where the category is positioned:
 * An icon, a category name, and a title, if the category extends
 * OptionsCategory. The icon is displayed in the left sidebar of the Basic
 * Options view, the category name is also displayed in the left sidebar,
 * while the title is displayed in the panel itself.
 *
 * @version    1.0, 2006/Jul/12
 * @author     Andrea Matsunaga
 */
public class CheckstyleOptionsCategory extends OptionsCategory {
    /**
     * Retrieves the name of this options category.
     * @return Checkstyle category name
     */
    public String getCategoryName() {
        return NbBundle.getMessage(Checkstyle.class, "CTL_Checkstyle");
    }

    /**
     * Retrieves the title of this options category.
     * @return Checkstyle category title
     */
    public String getTitle() {
        return NbBundle.getMessage(Checkstyle.class, "CTL_Checkstyle_Title");
    }

    /**
     * Retrieves the icon to be displayed in the options category.
     * @return Checkstyle icon
     */
    public Icon getIcon() {
        return new ImageIcon(Utilities.loadImage("com/ammatsun/checkstyle4nb/actions/checkstyle24.gif"));
    }

    /**
     * Retrieves the panel controller to be used for this options category.
     * @return Checkstyle panel controller
     */
    public OptionsPanelController create() {
        return new CheckstyleOptionsPanelController();
    }
}
